﻿using System;
using System.Collections.Generic;
using Citi.ReportManager.Domain;
using Citi.RoutineBase;

namespace Citi.ReportManager.SchedulerUi
{
    public class BackupFile : IExecutableRoutine
    {
        public IEnumerable<RoutineParameter> Parameters
        {
            get { return null; }
        }

        public void Rollback(ref ICurrentAction currentAction, Dictionary<string, object> parameters)
        {

        }

        public void Start(DateTime scheduledDate, ref ICurrentAction currentAction, Dictionary<string, object> parameters)
        {
            new CopyFileLocal(currentAction).StartCopy(new ReportFolder().SelectAll<ReportFolder>());
        }
        
        public void Stop(ref ICurrentAction currentAction, Dictionary<string, object> parameters)
        {

        }
    }

    public class CopyFileLocal : CopyFile
    {
        private ICurrentAction action;

        public CopyFileLocal(ICurrentAction currentAction)
        {
            this.action = currentAction;
        }

        public override string StepDescription
        {
            set
            {
                action.Description = value;
            }
        }
    }
}
